<template>
  <div>
    <van-button  type="primary" size="large">房屋信息展示</van-button>
    <!--房间信息展示-->
    <van-swipe-cell v-for="(house,index) in houseList" :key="house">
      <van-cell :border="false" title="小区信息:" :value=house.xiaoqu />
      <van-cell :border="false" title="房间信息:" :value=house.loudong+house.danyuan+house.fangjian />
      <template #right>
        <van-button square text="编辑" type="danger" class="delete-button" to="/addHouse"/>
        <van-button square text="删除" type="danger" class="delete-button"/>
      </template>
      <hr/>
    </van-swipe-cell>
    <!--添加房间信息按钮-->
    <van-button icon="plus" type="info" size="large" round class="but" to="/addHouse">添加房屋信息</van-button>
  </div>
</template>

<script>
  import axios from 'axios';
  export default {
    name: "house",

    data(){
      return{
        houseList:[
          {xiaoqu:"南窑头国际",loudong:"01栋",danyuan:"1单元",fangjian:"0101"},
          {xiaoqu:"南窑头国际",loudong:"02栋",danyuan:"1单元",fangjian:"0102"},
          {xiaoqu:"南窑头国际",loudong:"03栋",danyuan:"1单元",fangjian:"0103"}
        ]
      }
    },
    methods:{

    },
    // created(){
    //   //alert("123")
    //   axios.get("house/findHouseByUid").then(resp=>{
    //     if (resp.data.code == 1) {
    //       this.houseList=resp.data.data
    //     }
    //   })
    // }
  }
</script>

<style scoped>
  .delete-button {
    height: 100%;
  }
  .but{
    margin-top: 50px;
    width: 250px;
  }
</style>
